package com.zyf.annotationprocessordemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
import android.widget.ToggleButton;

import com.zyf.appannotation.BindView;
import com.zyf.appapi.ZViewBinder;

/**
 * @author zyf
 * @date 2018/3/9
 */
public class MainActivity extends AppCompatActivity {
    @BindView(R.id.btn)
    ToggleButton mButton;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_main);
        ZViewBinder.bind(this);
        mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "bind success", Toast.LENGTH_SHORT).show();
            }
        });
    }

    @Override
    protected void onDestroy() {
        ZViewBinder.unBind(this);
        super.onDestroy();
    }
}
